package com.ehome.emergency.entities;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * emergency
 *
 * @author: haoxiaolei
 * @date: 2016-08-04 11:06
 * @desc: 政府机构
 */
@Entity
@Table(name = "share_organization")
@DynamicInsert
@DynamicUpdate
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "com.ehome.emergency.entities.Organization")
public class Organization implements Serializable {
    private static final long serialVersionUID = 1437691882828932144L;

    //成员变量**********************************************************************
    /**
     * 主键
     */
    @Id
    @GenericGenerator(name = "share_organization_id_generator", strategy = "native")
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    /**
     * 名称
     */
    @Column(name = "name", length = 130, nullable = false)
    private String name;
    /**
     * 地址
     */
    @Column(name = "address")
    private String address;
    /**
     * 纬度，东西方向上的，即：x线
     */
    @Column(name = "latitude", length = 20)
    private String latitude;
    /**
     * 经度，南北方向上的，即：y线
     */
    @Column(name = "longitude", length = 20)
    private String longitude;
    /**
     * 图标
     */
    @Column(name = "icon")
    private String icon;
    /**
     * 联系电话
     */
    @Column(name = "tel", length = 20)
    private String tel;
    /**
     * 描述
     */
    @Column(name = "description")
    private String description;
    /**
     * 上级机构Id
     */
    @Column(name = "p_org_id")
    private Long parentOrgId;

    //setter/getter****************************************************************
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getParentOrgId() {
        return parentOrgId;
    }

    public void setParentOrgId(Long parentOrgId) {
        this.parentOrgId = parentOrgId;
    }
}
